package com.ydjk.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ydjk.common.utils.DateUtils;
import com.ydjk.domain.JkPushUser;
import com.ydjk.mapper.JkPushUserMapper;
import com.ydjk.service.IJkPushUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 推送人员Service业务层处理
 *
 * @author ydjk
 * @date 2023-09-12
 */
@Service
public class JkPushUserServiceImpl extends ServiceImpl<JkPushUserMapper, JkPushUser> implements IJkPushUserService {
    @Autowired
    private JkPushUserMapper jkPushUserMapper;

    /**
     * 查询推送人员
     *
     * @param id 推送人员主键
     * @return 推送人员
     */
    @Override
    public JkPushUser selectJkPushUserById(Long id) {
        return jkPushUserMapper.selectJkPushUserById(id);
    }

    /**
     * 查询推送人员列表
     *
     * @param jkPushUser 推送人员
     * @return 推送人员
     */
    @Override
    public List<JkPushUser> selectJkPushUserList(JkPushUser jkPushUser) {
        return jkPushUserMapper.selectJkPushUserList(jkPushUser);
    }

    /**
     * 新增推送人员
     *
     * @param jkPushUser 推送人员
     * @return 结果
     */
    @Override
    public int insertJkPushUser(JkPushUser jkPushUser) {
        jkPushUser.setCreateTime(DateUtils.getNowDate());
        return jkPushUserMapper.insertJkPushUser(jkPushUser);
    }

    /**
     * 修改推送人员
     *
     * @param jkPushUser 推送人员
     * @return 结果
     */
    @Override
    public int updateJkPushUser(JkPushUser jkPushUser) {
        return jkPushUserMapper.updateJkPushUser(jkPushUser);
    }

    /**
     * 批量删除推送人员
     *
     * @param ids 需要删除的推送人员主键
     * @return 结果
     */
    @Override
    public int deleteJkPushUserByIds(Long[] ids) {
        return jkPushUserMapper.deleteJkPushUserByIds(ids);
    }

    /**
     * 删除推送人员信息
     *
     * @param id 推送人员主键
     * @return 结果
     */
    @Override
    public int deleteJkPushUserById(Long id) {
        return jkPushUserMapper.deleteJkPushUserById(id);
    }
}
